export const store = {
    state: {
      loading: false,
    },
    action: {
      showLoading(state, action) {
        state.loading = true;
      },
      hideLoading(state, action) {
        state.loading = false;
      },
    },
  };
  let reducer = (
    state = {
      ...store.state,
    },
    action
  ) => {
    let newState = JSON.parse(JSON.stringify(state));
    if (store.action[action.type]) {
      store.action[action.type](newState, action);
    }
    return newState;
  }; 
  export default reducer;
  